home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
vbkontrol.exe
/
SHTDLL14.ZIP
/
SPTAPP.FRM
< prev
next >
Wrap
Text File
|
1995-06-26
|
7KB
|
262 lines
VERSION 2.00
Begin Form Form1
Caption = "Shtdll Sample Application"
ClientHeight = 6105
ClientLeft = 495
ClientTop = 1305
ClientWidth = 8700
Height = 6765
Icon = SPTAPP.FRX:0000
Left = 450
LinkTopic = "Form1"
ScaleHeight = 540
ScaleWidth = 540
Top = 690
Width = 8790
Begin TextBox Text1
BackColor = &H00FFFF00&
BorderStyle = 0 'None
ForeColor = &H000000FF&
Height = 255
Left = 2040
TabIndex = 2
Top = 360
Width = 1575
End
Begin PictureBox Picture1
Align = 1 'Align Top
Height = 375
Left = 0
ScaleHeight = 345
ScaleWidth = 8670
TabIndex = 0
Top = 0
Width = 8700
Begin CommandButton Command5
Caption = "Exit"
Height = 320
Left = 4440
TabIndex = 7
Top = 15
Width = 495
End
Begin CommandButton Command4
Caption = "Close"
Height = 320
Left = 3480
TabIndex = 6
Top = 15
Width = 855
End
Begin CommandButton Command3
Caption = "Read"
Height = 320
Left = 2640
TabIndex = 5
Top = 15
Width = 735
End
Begin CommandButton Command2
Caption = "Open"
Height = 320
Left = 1680
TabIndex = 4
Top = 15
Width = 855
End
Begin CommandButton Command1
Caption = "Open and Read"
Height = 320
Left = 60
TabIndex = 3
Top = 15
Width = 1455
End
End
Begin Grid Grid1
Cols = 20
Height = 5775
HighLight = 0 'False
Left = 0
Rows = 20
TabIndex = 1
Top = 360
Width = 8655
End
Begin Menu MnuFile
Caption = "File"
Begin Menu MnuOR
Caption = "Open and Read Sheet"
End
Begin Menu MnuOpen
Caption = "Open Sheet File"
End
Begin Menu MnuRead
Caption = "Read a Cell Value"
End
Begin Menu MnuClose
Caption = "Close Sheet File"
End
Begin Menu MnuEnd
Caption = "Exit"
End
End
Begin Menu MnuExit
Caption = "Exit"
Begin Menu MnuQuit
Caption = "Quit"
End
End
End
Dim A As String * 3
Dim pext As String * 3, hFile As Integer
Dim ggrd As grd
Sub adjwidth (grd As Grid)
For i% = 0 To grd.Cols - 1
grd.ColWidth(i%) = form1.TextWidth("ABCDEFGH")
Next
End Sub
Sub Clean_grid (grd As Grid)
grd.SelStartCol = grd.FixedCols
grd.SelStartRow = grd.FixedRows
grd.SelEndCol = grd.Cols - 1
grd.SelEndRow = grd.Rows - 1
' Clear the cells.
grd.Clip = ""
End Sub
Sub Command1_Click ()
Dim A As String
Dim txt As String * 256
Dim filename As String * 128
Clean_grid grid1
hFile = opensptfile(filename, pext, "", ggrd)
caption = "sheet: " & filename
Do While readsheets(hFile, pext, ggrd, txt)
If grid1.Cols < ggrd.Col + grid1.FixedCols + 1 Then grid1.Cols = ggrd.Col + grid1.FixedCols + 1
If ggrd.Col <> -1 Then grid1.Col = ggrd.Col + grid1.FixedCols
If grid1.Rows < ggrd.Row + grid1.FixedRows + 1 Then grid1.Rows = ggrd.Row + grid1.FixedRows + 1
If ggrd.Row <> -1 Then grid1.Row = ggrd.Row + grid1.FixedRows
grid1 = txt
Loop
End Sub
Sub Command1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
text1.Left = Command1.Left
text1 = "Open and read sheet"
text1.Width = form1.TextWidth(text1)
text1.Visible = True
End Sub
Sub Command2_Click ()
Dim filename As String * 128
Clean_grid grid1
hFile = opensptfile(filename, pext, "w1k", ggrd)
caption = "sheet: " & filename
End Sub
Sub Command2_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
text1.Left = Command2.Left
text1 = "Open sheet"
text1.Width = form1.TextWidth(text1.Text)
text1.Visible = True
End Sub
Sub Command3_Click ()
Dim txt As String * 256
i% = readsheets(hFile, pext, ggrd, txt)
If i% = 0 Then Exit Sub
If grid1.Cols < ggrd.Col + grid1.FixedCols + 1 Then grid1.Cols = ggrd.Col + grid1.FixedCols + 1
If grid1.Rows < ggrd.Row + grid1.FixedRows + 1 Then grid1.Rows = ggrd.Row + grid1.FixedRows + 1
If ggrd.Col <> -1 Then grid1.Col = ggrd.Col + grid1.FixedCols
If ggrd.Row <> -1 Then grid1.Row = ggrd.Row + grid1.FixedRows
grid1 = txt
End Sub
Sub Command3_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
text1.Left = Command3.Left
text1 = "read a cell value"
text1.Width = form1.TextWidth(text1.Text)
text1.Visible = True
End Sub
Sub Command4_Click ()
i% = flclose(hFile)
End Sub
Sub Command4_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
text1.Left = Command4.Left
text1 = "Close sheet file"
text1.Width = form1.TextWidth(text1.Text)
text1.Visible = True
End Sub
Sub Command5_Click ()
i% = flclose(hFile)
caption = "Open Sheet Sample Code"
End
End Sub
Sub Command5_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
text1.Left = Command5.Left
text1 = "Exit"
text1.Width = form1.TextWidth(text1.Text)
text1.Visible = True
End Sub
Sub Form_Load ()
adjwidth grid1
grid1.Top = picture1.Height
grid1.Height = ScaleHeight - grid1.Top
grid1.Width = ScaleWidth
text1.Visible = False
End Sub
Sub Form_Resize ()
grid1.Top = picture1.Height
grid1.Height = ScaleHeight - grid1.Top
grid1.Width = ScaleWidth
End Sub
Sub Grid1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
text1.Visible = False
End Sub
Sub MnuClose_Click ()
Command4_Click
End Sub
Sub MnuEnd_Click ()
End
End Sub
Sub MnuOpen_Click ()
Command2_Click
End Sub
Sub MnuOR_Click ()
Command1_Click
End Sub
Sub MnuQuit_Click ()
Command5_Click
End Sub
Sub MnuRead_Click ()
Command3_Click
End Sub
Sub Text1_KeyPress (KEYASCII As Integer)
KEYASCII = 0
End Sub